package com.ulook.lookplanet.mapper;

import com.ulook.lookplanet.bean.TCornUser;
import com.ulook.lookplanet.bean.TUser;
import com.ulook.lookplanet.bean.VUserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 描述：
 *
 * @author L1998
 * @date 2021/3/27
 */
@Mapper
@Repository
public interface HomeMapper {

    /**
     * 获取用户页面展示的信息
     * @param id
     * @return
     */
    @Select("select * from v_user_info where id = #{id}")
    VUserInfo getUserInfo(@Param("id") int id);

    @Select("select * from t_user where id = #{id}")
    TUser getTUserById(@Param("id") int id);

    /**
     * 是否关注
     */
    TCornUser isCornUser(TCornUser cornUser);

    void addCornUser(TCornUser cornUser);
    void deleteCornUser(TCornUser cornUser);

    /**
     * 获取关注列表
     */
    List<TUser> getFriends(int userid);

    /**
     * 修改信息
     */
    void updateUserInfo(TUser user);
}
